package com.vegan_friendly;

import android.os.Bundle;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTabHost;
import android.view.Menu;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class HomeActivity extends TabActivity  {

	private TabHost mTabHost;
	 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_home);
		
       // mTabHost = (TabHost)findViewById(android.R.id.tabhost);
      
		CommunicationManager.Inst().GetDataFromServer();
        
        TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);

        TabSpec firstTabSpec = tabHost.newTabSpec("tid1");
        TabSpec secondTabSpec = tabHost.newTabSpec("tid1");

        /** TabSpec setIndicator() is used to set name for the tab. */
        /** TabSpec setContent() is used to set content for a particular tab. */
        firstTabSpec.setIndicator("First Tab Name").setContent(new Intent(this,MainActivity.class));
        secondTabSpec.setIndicator("second Tab Name").setContent(new Intent(this,MainActivity.class));

        /** Add tabSpec to the TabHost to display. */
        tabHost.addTab(firstTabSpec);
        tabHost.addTab(secondTabSpec);
        
        
        /*mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent);

        mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"),
                HomeFragment.class, null);
        mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"),
                HomeFragment.class, null);
        mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"),
                HomeFragment.class, null);
                */

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_home, menu);
		return true;
	}

}
